package io.chenglicun.modules.clc.service.dataset.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.chenglicun.common.service.impl.CrudServiceImpl;
import io.chenglicun.common.constant.Constant;
import io.chenglicun.modules.clc.dao.dataset.ViewExcelMapHouseInfoDao;
import io.chenglicun.modules.clc.dto.dataset.ViewExcelMapHouseInfoDTO;
import io.chenglicun.modules.clc.entity.dataset.ViewExcelMapHouseInfoEntity;
import io.chenglicun.modules.clc.service.dataset.ViewExcelMapHouseInfoService;
import io.chenglicun.modules.clcLocationMark.entity.ClcLocationMarkEntity;
import io.chenglicun.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * VIEW
 *
 * @author HB 137664951@qq.com
 * @since 1.0 2024-03-21
 */
@Service
public class ViewExcelMapHouseInfoServiceImpl extends CrudServiceImpl<ViewExcelMapHouseInfoDao, ViewExcelMapHouseInfoEntity, ViewExcelMapHouseInfoDTO> implements ViewExcelMapHouseInfoService {

    @Override
    public QueryWrapper<ViewExcelMapHouseInfoEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<ViewExcelMapHouseInfoEntity> wrapper = new QueryWrapper<>();

        if(null != params.get("locationMarkId") && !"".equals(params.get("locationMarkId").toString())) {
            wrapper.lambda().eq(ViewExcelMapHouseInfoEntity::getLocationMarkId, params.get("locationMarkId"));
        }

        if(null != params.get("girdId") && !"".equals(params.get("girdId").toString())) {
            wrapper.lambda().eq(ViewExcelMapHouseInfoEntity::getGirdId, params.get("girdId"));
        }
        if(null != params.get("gridOfVillageId") && !"".equals(params.get("gridOfVillageId").toString())) {
            wrapper.lambda().eq(ViewExcelMapHouseInfoEntity::getGridOfVillageId, params.get("gridOfVillageId"));
        }
        if(null != params.get("status") && !"".equals(params.get("status").toString())) {
            wrapper.lambda().eq(ViewExcelMapHouseInfoEntity::getStatus, params.get("status"));
        }

        if(null != params.get("locationType") && !"".equals(params.get("locationType").toString())) {
            wrapper.lambda().eq(ViewExcelMapHouseInfoEntity::getLocationType, params.get("locationType"));
        }

        return wrapper;
    }


    @Override
    public void importExcel(MultipartFile file) {

    }
}